Two Dimensional Plots:
    Function Plots | Countour Plots | Velocity Fields | Manipulating the Devices | Java Device

    Velocity Fields

    - visualisation of a velocity field -

    The command velocity_field plots a velocity field with arrows pointing in the direction of the given velocity field. The length of an arrow is proportional to the strength of the field. This command is completly written in Xi. Have a look at the code.

    The velocity field is defined by two 2-dimensional arrays u, v containing the X and Y components of the velocity field.

    (  1)>u=cos(dincarr(10,15)/20.);
    (  2)>v=transpose(sin(dincarr(15,10)/20.));
    (  3)>velocity_field(u,v);
    
    Okay, the arrows are to short. By default each arrow has only one segment with length 0.1. You can change the number of segments in each arrow with the parameter nsteps and the length of each segment with stepSize. Additional the parameter curve indicates that all points of an arrow will be connected with splines (default are lines).
    (  4)>window(0,\clearAll);
    (  5)>velocity_field(u,v,\nsteps=10,\stepSize=0.05,\curve);
    

    Just as a reminder: It is possible with the mouse to magnify, cut out something or move the plot in the same way you have done it with ordinary 2D plots. Add colors if you like.

    (  6)>loadct(rainbow(62));
    (  7)>velocity_field(u,v,\nsteps=10,\stepSize=0.05,\curve,\colors=iincarr(10,15)/2.5+2);
    
    Additional you can determine the abscissa and ordinate values by using the paramters x, y. Here x and y must be vectors, the size of y must be equal to the first dimension of u, v and x must be equal to the secound dimension of u, v.
    (  8)>x={0,1,2,3,4,5,6,7,8,9,11,13,15,17,19};
    (  9)>y={0,1,2,3,4,5,7,9,11,13};
    ( 10)>window(0,\clearAll);
    ( 11)>velocity_field(u,v,x,y,\stepSize=0.5);
    

    You can determine the starting points of each arrow with the parameters startX and startY.

    ( 12)>startx={5,13,6};
    ( 13)>starty={4,4.5,7};
    ( 14)>window(0,\clearAll);
    ( 15)>velocity_field(u,v,\startX=startx,\startY=starty,\nsteps=180,
    \stepSize=0.05,\curve,\headScale=0.05);
    
    The size of the arrow-head will be controlled by the parameter headScale (default 0.5). This is the proportional factor between the length of the arrow and sides of the arrow-head. Set noaxis if you don't want any axis. Titles etc. on the axis can be obtained by
    ( 16)>plot(\xrange={-1,15},\xtitle="x-title",\ytitle="!omega!Gamma");
    
    Add colors to the arrows
    ( 17)>window(0,\clearAll,\bpp=3);
    ( 18)>velocity_field(u,v,\startX=startx,\startY=starty,\nsteps=180,
    \stepSize=0.05,\curve,\headScale=0.05,\colors={4,5,7});
    


    Rechts Index Index Index Linls © 1995 by Bodo Junglas, Klaus Spanderen and Fabian Weis
    - Last revised: April 23 1996